package io;

import java.io.Serializable;
import java.util.Arrays;

/**
 * 使用当前类测试对象流的对象读写操作
 * 
 * @author Xiloer
 *
 */
public class Person implements Serializable{

	private static final long serialVersionUID = 1227440665375321720L;
	private String name;
	private int age;
	private String gender;
	/*
	 * transient关键字
	 * 当一个属性被该关键字修饰后，那么当对象序列化时，这个属性的值会被忽略
	 * 忽略不必要的属性可以达到对象瘦身的目的。
	 */
	private transient String[] otherInfo;

	public Person(String name, int age, String gender, String[] otherInfo) {
		super();
		this.name = name;
		this.age = age;
		this.gender = gender;
		this.otherInfo = otherInfo;
	}

	public String toString() {
		return name+","+age+","+gender+","+Arrays.toString(otherInfo);
	}
}





